package bookSystemService.impl;

import bookSystemDao.impl.BookStoreImpl;
import bookSystemEntity.BookStoreEntity;
import bookSystemService.BookStoreServiceDao;

public class BookStoreServiceImpl  implements BookStoreServiceDao {
    BookStoreImpl bo=new BookStoreImpl();
    @Override
    public int Login(BookStoreEntity book) {
        int count=0;
        try {

            if (book!=null){
                //把数据送到数据访问层
                count=bo.Login(book);
            }else {
                count=-1;
                System.out.println("登陆失败");
            }
        } catch (Exception e) {
            System.err.println("业务逻辑层"+e);
        }
        return count;
    }

    @Override
    public int Regist(BookStoreEntity book) {
        int count=0;
        try {
            if (book!=null){
                count=bo.Regist(book);
            }else {
                count=-1;
                System.out.println("注册失败");
            }
        } catch (Exception e) {
            System.err.println("业务逻辑层"+e);
        }
        return 0;
    }
}
